from django.urls import path
from .controllers import auth, user, vip, wechat_user, config
from .controllers.audio import get_audio_records

urlpatterns = [
    # 认证相关路由
    path('auth/login', auth.admin_login, name='admin_login'),
    path('auth/logout', auth.admin_logout, name='admin_logout'),
    path('auth/info', auth.admin_info, name='admin_info'),
    path('auth/change-password', auth.admin_change_password, name='admin_change_password'),
    
    # 用户管理路由
    path('users', user.user_list, name='user_list'),
    path('users/<int:user_id>', user.user_detail, name='user_detail'),
    path('users/create', user.user_create, name='user_create'),
    path('users/<int:user_id>/update', user.user_update, name='user_update'),
    path('users/<int:user_id>/delete', user.user_delete, name='user_delete'),
    
    # 微信用户管理路由
    path('wechat-users', wechat_user.wechat_user_list, name='wechat_user_list'),
    path('wechat-users/<int:user_id>', wechat_user.wechat_user_detail, name='wechat_user_detail'),
    path('wechat-users/<int:user_id>/update', wechat_user.wechat_user_update, name='wechat_user_update'),
    path('wechat-users/<int:user_id>/delete', wechat_user.wechat_user_delete, name='wechat_user_delete'),
    
    # VIP管理路由
    path('vip/packages', vip.vip_package_list, name='vip_package_list'),
    path('vip/packages/create', vip.vip_package_create, name='vip_package_create'),
    path('vip/packages/<int:package_id>/update', vip.vip_package_update, name='vip_package_update'),
    path('vip/packages/<int:package_id>/delete', vip.vip_package_delete, name='vip_package_delete'),
    path('vip/orders', vip.vip_order_list, name='vip_order_list'),
    path('vip/orders/<int:order_id>/update', vip.vip_order_update, name='vip_order_update'),
    
    # VIP会员管理路由
    path('vip/members', vip.vip_member_list, name='vip_member_list'),
    path('vip/members/create', vip.vip_member_create, name='vip_member_create'),
    path('vip/members/<int:member_id>', vip.vip_member_detail, name='vip_member_detail'),
    path('vip/members/<int:member_id>/update', vip.vip_member_update, name='vip_member_update'),
    path('vip/members/<int:member_id>/delete', vip.vip_member_delete, name='vip_member_delete'),
    
    # VIP激活码路由
    path('vip/activation-codes', vip.vip_activation_code_list, name='vip_activation_code_list'),
    path('vip/activation-codes/create', vip.vip_activation_code_create, name='vip_activation_code_create'),
    path('vip/activation-codes/batch-create', vip.vip_activation_code_batch_create, name='vip_activation_code_batch_create'),
    path('vip/activation-codes/<int:code_id>/delete', vip.vip_activation_code_delete, name='vip_activation_code_delete'),
    
    # 仪表盘路由
    # path('dashboard/stats', dashboard.dashboard_stats, name='dashboard_stats'),
    
    # 配置管理
    path('config/list', config.get_config_list, name='admin_config_list'),
    path('config/save', config.save_configs, name='admin_config_save'),
    path('config/delete/<str:key>', config.delete_config, name='admin_config_delete'),
    path('audio/records', get_audio_records, name='admin_audio_records'),
] 